<template>
  <div>
{{$store.state.user.name}}
  </div>
</template>

<script>
import {mapMutations}from 'vuex'
export default {
created(){
 setTimeout(()=>{
    // this.$store.state.user.name='sisi'
   this.$store.commit('user/setName', '张雨霏')
  // this.setName('张雨霏')
 },2000)
},
methods:{
  ...mapMutations('user',['setName'])
}
}
</script>

<style>

</style>